package com.yj.easynavigationbar;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.yj.easynavigationbarlibaray.EasyNavigationBar;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        EasyNavigationBar easyNavigationBar = new EasyNavigationBar.Builder(this)
                .setContentView(R.layout.test_title)
                .builder();
        easyNavigationBar.setText(R.id.tv_title,"22");
        easyNavigationBar.setText(R.id.tv_sousuo,"33");
        easyNavigationBar.setImageResource(R.id.iv_sousuo,R.mipmap.iv_back);
        final TextView textView=easyNavigationBar.getAView(R.id.tv_sousuo);
        easyNavigationBar.setAViewOnClickListener(R.id.ll_sousuo,new View.OnClickListener(){

            @Override
            public void onClick(View view) {
                Toast.makeText(MainActivity.this, textView.getText(), Toast.LENGTH_SHORT).show();
            }
        });
    }
}
